import { createApp } from "vue";
import App from "./App.vue";
import router from "./router";
import "@/assets/index.scss";
import "element-plus/dist/index.css";
import "@/plugins/rem";
import "@/plugins/scroll";
import "@/plugins/theme";
import "@/assets/iconfont/iconfont.css";
import "babel-polyfill";
import ElementPlus from "element-plus";
import myLoading from "@/components/Loading.vue";
import pinia from "@/store";
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
let app = createApp(App);
app.component("myLoading", myLoading);
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}
app.config.globalProperties.noScroll = () => {
  document.body.style.overflow = "hidden";
};
app.config.globalProperties.canScroll = () => {
  document.body.style.overflow = "auto";
};
// app.config.globalProperties.Avatar = './src/assets/pics/avatar.png'
app.config.globalProperties.baseApi =
  import.meta.env.MODE === "production"
    ? "http://meipaimy.sxkj.fun:8021/"
    : "/baseApi/";
app.use(ElementPlus).use(pinia).use(router).mount("#app");
